<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org">
<head th:replace="admin/header::head-fragment"></head>

<body>
<div class="container-fluid p-t-15">

  <div class="row">
    <div class="col-lg-12">
      <div class="card">
        <div class="card-body">

          <form th:action="@{/admin/type/add}" method="post" class="row" th:object="${type}">
          <div class="form-group col-md-12">
            <div class="alert alert-danger alert-dismissible" role="alert" th:if="${#fields.hasErrors('name')}">
               <button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">&times;</span></button>
               <strong>操作提示: </strong><span th:errors="*{name}">提交信息不符合规则</span>
            </div>
              <label for="title">分类名称</label>
              <input type="text" class="form-control" id="title" name="name" th:value="*{name}" placeholder="请输入分类名称" />
            </div>
            <div class="form-group col-md-12">
              <label for="state">状态</label>
              <div class="clearfix">
                <label class="lyear-radio radio-inline radio-primary">
                  <input type="radio" name="state"  value="0"><span>禁用</span>
                </label>
                <label class="lyear-radio radio-inline radio-primary">
                  <input type="radio" name="state"  value="1" checked><span>启用</span>
                </label>
              </div>
            </div>
            <div class="form-group col-md-12">
              <button type="submit" class="btn btn-primary ajax-post" target-form="add-form">添 加</button>
              <button type="button" class="btn btn-default" onclick="javascript:history.back(-1);return false;">返 回</button>
            </div>
          </form>

        </div>
      </div>
    </div>
  </div>
</div>
<script>
</script>
<script src="https://cdn.jsdelivr.net/gh/jquery/jquery@3.2.1/dist/jquery.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@3.3.7/dist/js/bootstrap.min.js"></script>
<script type="text/javascript" th:src="@{/admin/js/main.min.js}"></script>
</body>
</html>